home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr44
/
lrdchelp.zip
/
DROPFILE.DOC
next >
Wrap
Text File
|
1995-04-08
|
3KB
|
87 lines
What Do I Do For A Dropfile?
The preferred method is to read INFO.X directly and pass the
information on comport, speed, etc. to your door library
directly. I tried that with Opendoors and was somewhat less
than fully successful. So, I went to plan B...
Alternately, if your door library permits, you can define
INFO.X as a custom drop file type and let your door library
deal with getting the information it needs by reading the
file internally. This is the method used with TRX. Look
at the LRDTRX??.CFG files for an example of the format needed
for use with Opendoors.
If, for some reason, you really, really, REALLY have to have
a standard dropfile, the next best thing to do is to parse
it's location out of the NODEX.DAT file. This is Seth's
configuration file. It has lots of useful information in
there. This is the method I'm using in an as yet unreleased
IGM called Chrono's Tick-Tock Shop (I probably should be
working on it now, instead of doing this, but, what the
heck? <g>). The function below is what I use in that one.
It's kinda rough yet, but you should get the general idea.
If your door library needs the name of the drop file instead
of just the location, you can spiff this up a bit and get
that out of NODEX.DAT too.
void read_node( char *nodenum )
{
char temp[100];
char temp2[100];
char temp3[100];
FILE *f;
strcpy( temp, "NODE" );
strcat( temp, nodenum );
strcat( temp, ".DAT");
get_access_hard( temp );
f = fopen( temp, "rt" );
fgets( temp2, 81, f);
do
{
if (!strcmp( "BBSDROP", strtok( temp2, " ")))
{
strcpy( temp3, strtok( NULL, " "));
trim( temp3 );
strcpy( od_control.info_path, temp3 );
break;
}
} while (NULL != fgets( temp2, 81, f));
if (!strcmp( NULL, od_control.info_path))
{
printf("BUMMER! %s must be mangled. Can't find the BBSDROP parm.\n",
temp);
printf("Notify John Hutton\n"); // Use your own name, please!
fclose( f );
unlock_file( temp );
sleep( 3 );
exit( 0 );
}
fclose( f );
unlock_file( temp );
}
/* This just does the equivalant of an RTRIM - cuts off carriage
** returns, newlines, and space characters from the end of a string
*/
void trim( char *string )
{
int how_long;
how_long = strlen( string );
while ((string[how_long - 1] == 13) || (string[how_long - 1] == 10 )
|| (string[how_long - 1] == ' '))
{
string[how_long - 1] = '\0';
how_long = strlen( string );
}
}